package Year22_Month04.day25;

public class 赎金信 {
    public boolean canConstruct(String ransomNote, String magazine) {
        int[] key = new int[100];
        for(char c:magazine.toCharArray()){
            key[c] += 1;
        }
        for (char c:ransomNote.toCharArray()){
            key[c] -= 1;
            if(key[c] < 0){
                return false;
            }
        }
        return true;
    }
}
